<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>其他方法 | vue-element-dict</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="/vue-element-dict/favicon.ico">
    <script defer="defer" async="async" src="https://cpro.baidustatic.com/cpro/ui/cm.js"></script>
    <meta name="description" content="vue-element-dict字典包官方使用文档">
    
    <link rel="preload" href="/vue-element-dict/assets/css/0.styles.2f302933.css" as="style"><link rel="preload" href="/vue-element-dict/assets/js/app.796ae7e4.js" as="script"><link rel="preload" href="/vue-element-dict/assets/js/4.df041e95.js" as="script"><link rel="preload" href="/vue-element-dict/assets/js/32.6f3739df.js" as="script"><link rel="preload" href="/vue-element-dict/assets/js/5.a10e50db.js" as="script"><link rel="prefetch" href="/vue-element-dict/assets/js/1.9df3603b.js"><link rel="prefetch" href="/vue-element-dict/assets/js/10.55ebc9f1.js"><link rel="prefetch" href="/vue-element-dict/assets/js/11.ae1602ab.js"><link rel="prefetch" href="/vue-element-dict/assets/js/12.7a6d05ba.js"><link rel="prefetch" href="/vue-element-dict/assets/js/13.1d9a30ea.js"><link rel="prefetch" href="/vue-element-dict/assets/js/14.83cfdb89.js"><link rel="prefetch" href="/vue-element-dict/assets/js/15.c09cab0b.js"><link rel="prefetch" href="/vue-element-dict/assets/js/16.19c4ed7e.js"><link rel="prefetch" href="/vue-element-dict/assets/js/17.5c7fb955.js"><link rel="prefetch" href="/vue-element-dict/assets/js/18.b211f0fa.js"><link rel="prefetch" href="/vue-element-dict/assets/js/19.aa88b046.js"><link rel="prefetch" href="/vue-element-dict/assets/js/2.eb833b2e.js"><link rel="prefetch" href="/vue-element-dict/assets/js/20.740e71a2.js"><link rel="prefetch" href="/vue-element-dict/assets/js/21.814870f8.js"><link rel="prefetch" href="/vue-element-dict/assets/js/22.46503405.js"><link rel="prefetch" href="/vue-element-dict/assets/js/23.87118240.js"><link rel="prefetch" href="/vue-element-dict/assets/js/24.ac6635e4.js"><link rel="prefetch" href="/vue-element-dict/assets/js/25.f678ea41.js"><link rel="prefetch" href="/vue-element-dict/assets/js/26.d8cc5201.js"><link rel="prefetch" href="/vue-element-dict/assets/js/27.7078c96d.js"><link rel="prefetch" href="/vue-element-dict/assets/js/28.57b6222a.js"><link rel="prefetch" href="/vue-element-dict/assets/js/29.010701c9.js"><link rel="prefetch" href="/vue-element-dict/assets/js/30.c6e653d6.js"><link rel="prefetch" href="/vue-element-dict/assets/js/31.d1d5da99.js"><link rel="prefetch" href="/vue-element-dict/assets/js/33.d87a4b44.js"><link rel="prefetch" href="/vue-element-dict/assets/js/34.3eca72ee.js"><link rel="prefetch" href="/vue-element-dict/assets/js/35.0a8dc5d9.js"><link rel="prefetch" href="/vue-element-dict/assets/js/36.121eaca2.js"><link rel="prefetch" href="/vue-element-dict/assets/js/37.dc841a6a.js"><link rel="prefetch" href="/vue-element-dict/assets/js/38.70886628.js"><link rel="prefetch" href="/vue-element-dict/assets/js/6.10b21df8.js"><link rel="prefetch" href="/vue-element-dict/assets/js/7.b647619a.js"><link rel="prefetch" href="/vue-element-dict/assets/js/8.4a0866ed.js"><link rel="prefetch" href="/vue-element-dict/assets/js/9.9ff5451c.js">
    <link rel="stylesheet" href="/vue-element-dict/assets/css/0.styles.2f302933.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vue-element-dict/" class="home-link router-link-active"><!----> <span class="site-name">vue-element-dict</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/vue-element-dict/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/vue-element-dict/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="https://www.npmjs.com/package/vue-element-dict" target="_blank" rel="noopener noreferrer" class="nav-link external">
  npm地址
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/vue-element-dict/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/vue-element-dict/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="https://www.npmjs.com/package/vue-element-dict" target="_blank" rel="noopener noreferrer" class="nav-link external">
  npm地址
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/guide/" class="sidebar-link">介绍</a></li><li><a href="/vue-element-dict/guide/fast/" class="sidebar-link">快速开始</a></li><li><a href="/vue-element-dict/guide/directory-structure/" class="sidebar-link">目录结构</a></li><li><a href="/vue-element-dict/guide/config/" class="sidebar-link">字典包配置</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>普通字典组件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/components/el-select-dict/" class="sidebar-link">select-dict选择器</a></li><li><a href="/vue-element-dict/components/el-radio-dict/" class="sidebar-link">radio-dict单选框</a></li><li><a href="/vue-element-dict/components/el-checkbox-dict/" class="sidebar-link">checkbox-dict多选框</a></li><li><a href="/vue-element-dict/components/el-radio-button-dict/" class="sidebar-link">radio-button-dict单选框</a></li><li><a href="/vue-element-dict/components/el-checkbox-button-dict/" class="sidebar-link">checkbox-button-dict多选框</a></li><li><a href="/vue-element-dict/components/el-tabs-dict/" class="sidebar-link">tabs-dict标签页</a></li><li><a href="/vue-element-dict/components/el-tag-dict/" class="sidebar-link">tag-dict标签</a></li><li><a href="/vue-element-dict/components/el-link-dict/" class="sidebar-link">link-dict链接</a></li><li><a href="/vue-element-dict/components/el-button-dict/" class="sidebar-link">button-dict链接</a></li><li><a href="/vue-element-dict/components/el-table-colmun-dict/" class="sidebar-link">el-table-colmun-dict表格</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>树形字典组件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/components/el-cascader-dict/" class="sidebar-link">cascader-dict联级选项</a></li><li><a href="/vue-element-dict/components/el-tree-dict/" class="sidebar-link">tree-dict树菜单</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>其他组件</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/components/el-cascader-new/" class="sidebar-link">cascader-new联级选项</a></li><li><a href="/vue-element-dict/components/el-tree-new/" class="sidebar-link">tree-new树菜单</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>过滤器</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/filters/dict/" class="sidebar-link">字典过滤器</a></li><li><a href="/vue-element-dict/filters/tree-dict/" class="sidebar-link">树形字典过滤器</a></li><li><a href="/vue-element-dict/filters/other/" class="sidebar-link">其他过滤器</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>方法</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-element-dict/functions/dict/" class="sidebar-link">字典方法</a></li><li><a href="/vue-element-dict/functions/tree-dict/" class="sidebar-link">树形字典方法</a></li><li><a href="/vue-element-dict/functions/other/" aria-current="page" class="active sidebar-link">其他方法</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vue-element-dict/functions/other/#使用示例" class="sidebar-link">使用示例</a></li><li class="sidebar-sub-header"><a href="/vue-element-dict/functions/other/#functions-other-api" class="sidebar-link">Functions Other Api</a></li><li class="sidebar-sub-header"><a href="/vue-element-dict/functions/other/#日期格式" class="sidebar-link">日期格式</a></li></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="其他方法"><a href="#其他方法" class="header-anchor">#</a> 其他方法</h1> <p>字典之外其他相关的全局方法，使用这些方法</p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>字典包会自动将方法挂在到Vue实例中，在页面上可以直接调用 this.$方法调用该方法</p></div> <h2 id="使用示例"><a href="#使用示例" class="header-anchor">#</a> 使用示例</h2> <div class="demo-block demo-functions demo-" data-v-5390b29b><div class="source-bg" style="padding:24px" data-v-5390b29b><!----></div> <div class="meta" data-v-5390b29b><div class="description" data-v-5390b29b><p data-v-5390b29b><code data-v-5390b29b>desensitization</code> 第一个参数接收脱敏类型或者表示展示前面几项，第二个参数接收默认值，第三个参数接收展示后面几项，第四个参数用来配置中间展示几个*</p> <p data-v-5390b29b><code data-v-5390b29b>dayFormat</code> 第一个参数接收格式化类型，可选date、month、datetime、time、year，或者<a href="/vue-element-dict/filters/other/#日期格式">自定义格式</a>，第二个参数接收默认值</p></div> <div class="sourceCode" data-v-5390b29b><div class="language-vue extra-class" data-v-5390b29b><pre class="language-vue" data-v-5390b29b><code data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>template</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
  <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>functions-dict<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>沈小布脱敏下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer1<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer1}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer1<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>desensitization(<span class="token punctuation" data-v-5390b29b>'</span>沈小布<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>name<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer1<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>18830593872脱敏下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer2<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer2}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer2<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>desensitization(<span class="token punctuation" data-v-5390b29b>'</span>18830593872<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>mobile<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer2<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>350624199501051314脱敏下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer3<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer3}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer3<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>desensitization(<span class="token punctuation" data-v-5390b29b>'</span>350624199501051314<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>idCard<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer3<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>宁夏回族自治区金滩村涌泉街道脱敏下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer4<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer4}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer4<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>desensitization(<span class="token punctuation" data-v-5390b29b>'</span>宁夏回族自治区金滩村涌泉街道脱敏下<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>idCard<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer4<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>19950105日期格式化一下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer5<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer5}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer5<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>dayFormat(<span class="token punctuation" data-v-5390b29b>'</span>19950105<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>date<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer5<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>questions-box flex-c-b<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>question<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>19950105141222日期时间格式化一下?<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>answer6<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>{{answer6}}<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>v-if</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>!answer6<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>dayFormat(<span class="token punctuation" data-v-5390b29b>'</span>19950105141222<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>datetime<span class="token punctuation" data-v-5390b29b>'</span>, <span class="token punctuation" data-v-5390b29b>'</span>answer6<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>点击获取结果<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>reset<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>重置<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>

    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>div</span> <span class="token attr-name" data-v-5390b29b>class</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>flex-c-s flex-col<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      原生element的message消息提示如下，请连续点击按钮并查看效果
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>message(<span class="token punctuation" data-v-5390b29b>'</span>Message<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>原生element消息提示<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
      字典包消息提示
      <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>el-button</span> <span class="token attr-name" data-v-5390b29b>type</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>primary<span class="token punctuation" data-v-5390b29b>&quot;</span></span> <span class="token attr-name" data-v-5390b29b>@click</span><span class="token attr-value" data-v-5390b29b><span class="token punctuation attr-equals" data-v-5390b29b>=</span><span class="token punctuation" data-v-5390b29b>&quot;</span>message(<span class="token punctuation" data-v-5390b29b>'</span>message<span class="token punctuation" data-v-5390b29b>'</span>)<span class="token punctuation" data-v-5390b29b>&quot;</span></span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>字典包消息提示<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>el-button</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
    <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>

  <span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>div</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>template</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>

<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>script</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span><span class="token script" data-v-5390b29b><span class="token language-javascript" data-v-5390b29b>
<span class="token keyword" data-v-5390b29b>import</span> <span class="token punctuation" data-v-5390b29b>{</span>Message<span class="token punctuation" data-v-5390b29b>}</span> <span class="token keyword" data-v-5390b29b>from</span> <span class="token string" data-v-5390b29b>&quot;element-ui&quot;</span>
<span class="token keyword" data-v-5390b29b>import</span> <span class="token punctuation" data-v-5390b29b>{</span>dayFormat<span class="token punctuation" data-v-5390b29b>}</span> <span class="token keyword" data-v-5390b29b>from</span> <span class="token string" data-v-5390b29b>&quot;~/index.js&quot;</span>
<span class="token keyword" data-v-5390b29b>export</span> <span class="token keyword" data-v-5390b29b>default</span> <span class="token punctuation" data-v-5390b29b>{</span>
  <span class="token literal-property property" data-v-5390b29b>name</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;functions-other&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
  <span class="token function" data-v-5390b29b>data</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token punctuation" data-v-5390b29b>)</span> <span class="token punctuation" data-v-5390b29b>{</span>
    <span class="token keyword" data-v-5390b29b>return</span> <span class="token punctuation" data-v-5390b29b>{</span>
      <span class="token literal-property property" data-v-5390b29b>answer1</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
      <span class="token literal-property property" data-v-5390b29b>answer2</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
      <span class="token literal-property property" data-v-5390b29b>answer3</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
      <span class="token literal-property property" data-v-5390b29b>answer4</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
      <span class="token literal-property property" data-v-5390b29b>answer5</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span><span class="token punctuation" data-v-5390b29b>,</span>
      <span class="token literal-property property" data-v-5390b29b>answer6</span><span class="token operator" data-v-5390b29b>:</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span>
    <span class="token punctuation" data-v-5390b29b>}</span>
  <span class="token punctuation" data-v-5390b29b>}</span><span class="token punctuation" data-v-5390b29b>,</span>
  <span class="token function" data-v-5390b29b>created</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token punctuation" data-v-5390b29b>)</span> <span class="token punctuation" data-v-5390b29b>{</span>
    <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>$Message <span class="token operator" data-v-5390b29b>=</span> Message
  <span class="token punctuation" data-v-5390b29b>}</span><span class="token punctuation" data-v-5390b29b>,</span>
  <span class="token literal-property property" data-v-5390b29b>methods</span><span class="token operator" data-v-5390b29b>:</span> <span class="token punctuation" data-v-5390b29b>{</span>
    <span class="token function" data-v-5390b29b>reset</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token punctuation" data-v-5390b29b>)</span> <span class="token punctuation" data-v-5390b29b>{</span>
      <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer1 <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer2 <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer3 <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer4 <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer5 <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span>answer6 <span class="token operator" data-v-5390b29b>=</span> <span class="token string" data-v-5390b29b>&quot;&quot;</span>
    <span class="token punctuation" data-v-5390b29b>}</span><span class="token punctuation" data-v-5390b29b>,</span>
    <span class="token comment" data-v-5390b29b>//通过值获取中文值</span>
    <span class="token function" data-v-5390b29b>desensitization</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token parameter" data-v-5390b29b>val<span class="token punctuation" data-v-5390b29b>,</span> type<span class="token punctuation" data-v-5390b29b>,</span> answer</span><span class="token punctuation" data-v-5390b29b>)</span> <span class="token punctuation" data-v-5390b29b>{</span>
      <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>[</span>answer<span class="token punctuation" data-v-5390b29b>]</span> <span class="token operator" data-v-5390b29b>=</span> <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>.</span><span class="token function" data-v-5390b29b>$desensitization</span><span class="token punctuation" data-v-5390b29b>(</span>val<span class="token punctuation" data-v-5390b29b>,</span> type<span class="token punctuation" data-v-5390b29b>)</span>
    <span class="token punctuation" data-v-5390b29b>}</span><span class="token punctuation" data-v-5390b29b>,</span>
    <span class="token function" data-v-5390b29b>dayFormat</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token parameter" data-v-5390b29b>val<span class="token punctuation" data-v-5390b29b>,</span> type<span class="token punctuation" data-v-5390b29b>,</span> answer</span><span class="token punctuation" data-v-5390b29b>)</span> <span class="token punctuation" data-v-5390b29b>{</span>
      <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>[</span>answer<span class="token punctuation" data-v-5390b29b>]</span> <span class="token operator" data-v-5390b29b>=</span> <span class="token function" data-v-5390b29b>dayFormat</span><span class="token punctuation" data-v-5390b29b>(</span>val<span class="token punctuation" data-v-5390b29b>,</span> type<span class="token punctuation" data-v-5390b29b>)</span>
    <span class="token punctuation" data-v-5390b29b>}</span><span class="token punctuation" data-v-5390b29b>,</span>
    <span class="token function" data-v-5390b29b>message</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token parameter" data-v-5390b29b>type</span><span class="token punctuation" data-v-5390b29b>)</span><span class="token punctuation" data-v-5390b29b>{</span>
      <span class="token keyword" data-v-5390b29b>this</span><span class="token punctuation" data-v-5390b29b>[</span><span class="token string" data-v-5390b29b>&quot;$&quot;</span> <span class="token operator" data-v-5390b29b>+</span> type<span class="token punctuation" data-v-5390b29b>]</span><span class="token punctuation" data-v-5390b29b>.</span><span class="token function" data-v-5390b29b>success</span><span class="token punctuation" data-v-5390b29b>(</span><span class="token string" data-v-5390b29b>&quot;vue-element-dict真棒！&quot;</span><span class="token punctuation" data-v-5390b29b>)</span>
    <span class="token punctuation" data-v-5390b29b>}</span>
  <span class="token punctuation" data-v-5390b29b>}</span>
<span class="token punctuation" data-v-5390b29b>}</span>
</span></span><span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>script</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>

<span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;</span>style</span> <span class="token attr-name" data-v-5390b29b>scoped</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span><span class="token style" data-v-5390b29b><span class="token language-css" data-v-5390b29b>
<span class="token selector" data-v-5390b29b>.questions-box</span><span class="token punctuation" data-v-5390b29b>{</span>
  <span class="token property" data-v-5390b29b>margin-bottom</span><span class="token punctuation" data-v-5390b29b>:</span> 20px<span class="token punctuation" data-v-5390b29b>;</span>
<span class="token punctuation" data-v-5390b29b>}</span>
</span></span><span class="token tag" data-v-5390b29b><span class="token tag" data-v-5390b29b><span class="token punctuation" data-v-5390b29b>&lt;/</span>style</span><span class="token punctuation" data-v-5390b29b>&gt;</span></span>
</code></pre></div></div></div> <div class="demo-block-control" data-v-5390b29b><i class="el-icon-caret-bottom" data-v-5390b29b data-v-5390b29b></i> <span style="display:none;" data-v-5390b29b data-v-5390b29b>显示代码</span></div></div> <!----> <h2 id="functions-other-api"><a href="#functions-other-api" class="header-anchor">#</a> Functions Other Api</h2> <div class="language-js extra-class"><pre class="language-js"><code> 
<span class="token comment">/**
 * @description: 将数据脱敏
 * @param {*} val 脱敏数据值
 * @param {*} type 脱敏类型  可选 name, mobile, address, idCard 数字类型时表示 展示前面几位数
 * @param {*} defaultVal 默认值
 * @param {*} desensitizationEnd 展示后面几位
 * @param {*} desensitizationPlaceholder 展示中间几位
 * @return {*} 返回脱敏后的数据
 * @author: syx
 */</span>
<span class="token keyword">const</span> desensitization <span class="token operator">=</span> <span class="token punctuation">(</span>val<span class="token punctuation">,</span> type<span class="token punctuation">,</span> defaultVal<span class="token punctuation">,</span> desensitizationEnd<span class="token punctuation">,</span> desensitizationPlaceholder<span class="token punctuation">)</span>

  <span class="token comment">/**
   * @description: dayFormat 通过时间日期值展示正确想要的格式
   * @param {*} val 日期值
   * @param {*} type 格式化类型 可选date、month、datetime、time、year。或者自定义格式
   * @param {*} defaultVal 默认值  默认 &quot;&quot;
   * @return {*} date  返回时间格式  如果没有或者日期错误  则展示默认值
   * @author: syx
   */</span>  
<span class="token keyword">const</span> dayFormat <span class="token operator">=</span> <span class="token punctuation">(</span>val<span class="token punctuation">,</span> type<span class="token punctuation">,</span> defaultVal <span class="token operator">=</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span>

</code></pre></div><h2 id="日期格式"><a href="#日期格式" class="header-anchor">#</a> 日期格式</h2> <p>使用<code>dateFormat</code>指定日期数据返回的格式</p> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>请注意大小写</p></div> <table><thead><tr><th style="text-align:left;">标识</th> <th style="text-align:left;">示例</th> <th style="text-align:left;">描述</th></tr></thead> <tbody><tr><td style="text-align:left;">YY</td> <td style="text-align:left;">18</td> <td style="text-align:left;">年，两位数</td></tr> <tr><td style="text-align:left;">YYYY</td> <td style="text-align:left;">2018</td> <td style="text-align:left;">年，四位数</td></tr> <tr><td style="text-align:left;">M</td> <td style="text-align:left;">1-12</td> <td style="text-align:left;">月，从1开始</td></tr> <tr><td style="text-align:left;">MM</td> <td style="text-align:left;">01-12</td> <td style="text-align:left;">月，两位数字</td></tr> <tr><td style="text-align:left;">MMM</td> <td style="text-align:left;">Jan-Dec</td> <td style="text-align:left;">月，英文缩写</td></tr> <tr><td style="text-align:left;">D</td> <td style="text-align:left;">1-31</td> <td style="text-align:left;">日</td></tr> <tr><td style="text-align:left;">DD</td> <td style="text-align:left;">01-31</td> <td style="text-align:left;">日，两位数</td></tr> <tr><td style="text-align:left;">H</td> <td style="text-align:left;">0-23</td> <td style="text-align:left;">24小时</td></tr> <tr><td style="text-align:left;">HH</td> <td style="text-align:left;">00-23</td> <td style="text-align:left;">24小时，两位数</td></tr> <tr><td style="text-align:left;">h</td> <td style="text-align:left;">1-12</td> <td style="text-align:left;">12小时</td></tr> <tr><td style="text-align:left;">hh</td> <td style="text-align:left;">01-12</td> <td style="text-align:left;">12小时，两位数</td></tr> <tr><td style="text-align:left;">m</td> <td style="text-align:left;">0-59</td> <td style="text-align:left;">分钟</td></tr> <tr><td style="text-align:left;">mm</td> <td style="text-align:left;">00-59</td> <td style="text-align:left;">分钟，两位数</td></tr> <tr><td style="text-align:left;">s</td> <td style="text-align:left;">0-59</td> <td style="text-align:left;">秒</td></tr> <tr><td style="text-align:left;">ss</td> <td style="text-align:left;">00-59</td> <td style="text-align:left;">秒，两位数</td></tr> <tr><td style="text-align:left;">S</td> <td style="text-align:left;">0-9</td> <td style="text-align:left;">毫秒（百），一位数</td></tr> <tr><td style="text-align:left;">SS</td> <td style="text-align:left;">00-99</td> <td style="text-align:left;">毫秒（十），两位数</td></tr> <tr><td style="text-align:left;">SSS</td> <td style="text-align:left;">000-999</td> <td style="text-align:left;">毫秒，三位数</td></tr> <tr><td style="text-align:left;">Z</td> <td style="text-align:left;">-05:00</td> <td style="text-align:left;">UTC偏移</td></tr> <tr><td style="text-align:left;">ZZ</td> <td style="text-align:left;">-0500</td> <td style="text-align:left;">UTC偏移，两位数</td></tr> <tr><td style="text-align:left;">A</td> <td style="text-align:left;">AM / PM</td> <td style="text-align:left;">上/下午，大写</td></tr> <tr><td style="text-align:left;">a</td> <td style="text-align:left;">am / pm</td> <td style="text-align:left;">上/下午，小写</td></tr> <tr><td style="text-align:left;">Do</td> <td style="text-align:left;">1st... 31st</td> <td style="text-align:left;">月份的日期与序号</td></tr></tbody></table></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">6/29/2022, 3:01:11 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/vue-element-dict/functions/tree-dict/" class="prev">
        树形字典方法
      </a></span> <!----></p></div> </main></div><div class="global-ui"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i> <i></i> <i></i> <i></i></span></div></div><!----></div></div>
    <script src="/vue-element-dict/assets/js/app.796ae7e4.js" defer></script><script src="/vue-element-dict/assets/js/4.df041e95.js" defer></script><script src="/vue-element-dict/assets/js/32.6f3739df.js" defer></script><script src="/vue-element-dict/assets/js/5.a10e50db.js" defer></script>
  </body>
</html>
